<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // //数组的解构
        // const arr = [1, 2, 3]
        // //let [a, b, c] = arr
        // //console.log(a, b, c);
        // let [a, ...rest] = arr
        // console.log(a, rest);

        //对象的解构
        const obj = {
            name: 'zhangsan',
            age: 18,
            height: 1.88
        }
        let { name, age, height: h } = obj
        console.log(name, age, h);

    </script>
</body>

</html>